﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DynamicExcelImportWebControl" Namespace="DynamicExcelImportWebControl"
    TagPrefix="custom" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Dynamic Excel Import</title>
    <link rel="StyleSheet" href="css/excelimport.css" type="text/css" />
    <style type="text/css">
    .resultbox
    {
    	border: solid 2px black;
    	background-color:Yellow;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <h2>Dynamic Excel Import Web Control Example (2007.12.22)</h2>
<p>Code Example:</p>
<pre>
&lt;custom:ExcelImportControl runat="server" ID="ExcelImportControl2" OnSubmit="ExcelImportControl1_Submit">
    &lt;custom:StaticGridColumn HeaderName="Static Column 1" />
    &lt;custom:EditableGridColumn HeaderName="Editable Column 2" />
    &lt;custom:DropDownListColumn HeaderName="DropDownList Column 3">
        &lt;asp:ListItem Text="Number 1" Value="1" />
        &lt;asp:ListItem Text="Number 2" Value="2" Selected="True" />
        &lt;asp:ListItem Text="Number 3" Value="3" />
    &lt;/custom:DropDownListColumn>
&lt;/custom:ExcelImportControl>            
</pre>         


<p>How to use the example:</p>
<ol>
    <li>Create an excel spreadsheet containing data. This demonstration is limited to three columns,
        one static column, one editable column, and one dropdown column (in that order).</li>
    <li>Select and copy the cells in Excel to the clipboard.</li>
    <li>Paste the contents of the clipboard in to the text box below.</li>
    <li>When the Submit button is clicked, the table is serialized into JSON and submitted to the server.</li>
</ol>
            <custom:ExcelImportControl runat="server" ID="ExcelImportControl1" OnSubmit="ExcelImportControl1_Submit">
                <custom:StaticGridColumn HeaderName="Static Column 1" />
                <custom:EditableGridColumn HeaderName="Editable Column 2" />
                <custom:DropDownListColumn HeaderName="DropDownList Column 3">
                    <asp:ListItem Text="Number 1" Value="1" />
                    <asp:ListItem Text="Number 2" Value="2" Selected="True" />
                    <asp:ListItem Text="Number 3" Value="3" />
                </custom:DropDownListColumn>
            </custom:ExcelImportControl>

            <br/>
            <br/>
            <asp:Panel runat="server" ID="ResultsPanel" Visible="false" CssClass="resultbox">
                <center>Results:<br/>
                <asp:Label ID="Label1" runat="server" Text="" />
                </center>
            </asp:Panel>
            
            <h2>Possible Applications</h2>
            <ul>
            <li>User information import. (Username, Password, Domain, and a Role column)</li>
            <li>Graphing data points. (X and a Y column)</li>
            <li>Simple scheduling, or time tracking. (Date, Time, and an Event column)</li>
            <li>Any low volume, simple, data import.</li>
            </ul>
            
        </div>
    </form>
</body>
</html>
